#ifndef BONJOURREGISTER_H
#define BONJOURREGISTER_H

#include <QObject>
#include <dns_sd.h>

class BonjourRegister : public QObject
{
	Q_OBJECT

public:
	BonjourRegister(QObject *parent = 0);
	~BonjourRegister();
	void registerService(QString name, QString type, quint16 port);

signals:
	void bonjourError();

public slots:
	void receiveSomeInfo(int);	//called when the daemon has some info to send us (via callback)

private:
	DNSServiceRef serviceRef;

	static void DNSSD_API registerCallback(DNSServiceRef ref, DNSServiceFlags flags, DNSServiceErrorType error,
										   const char *name, const char *type, const char *domain, void *context);
};

#endif // BONJOURREGISTER_H
